package com.heima.admin.controller.v1;



import com.heima.api.wemedia.WemediaClient;
import com.heima.model.common.dtos.PageRequestDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmChannelDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/channel")
public class AdChannelController {

    @Autowired
    private WemediaClient wmChannelClient;
    @PostMapping("/list")
    public ResponseResult list(@RequestBody WmChannelDto dto) {
        return wmChannelClient.listAll(dto);
    }

    @PostMapping("/save")
    public ResponseResult add(@RequestBody WmChannelDto dto) {
        return wmChannelClient.add(dto);
    }

    @PostMapping("/update")
    public ResponseResult update(@RequestBody WmChannelDto dto) {
        return wmChannelClient.update(dto);
    }

    @GetMapping("/del/{id}")
    public ResponseResult delete(@PathVariable Integer id) {
        return wmChannelClient.remove(id);
    }
}
